// 用户相关常量定义
import { UserRole, UserStatus } from '@/types/user';

// 用户角色选项
export const USER_ROLE_OPTIONS = [
  { label: '超级管理员', value: UserRole.SUPER_ADMIN },
  { label: '管理员', value: UserRole.ADMIN },
  { label: '仪器负责人', value: UserRole.INSTRUMENT_MANAGER },
  { label: '仪器操作员', value: UserRole.INSTRUMENT_OPERATOR },
  { label: '财务', value: UserRole.FINANCE },
  { label: '1级用户', value: UserRole.LEVEL_1_USER },
  { label: '2级用户', value: UserRole.LEVEL_2_USER },
  { label: '3级用户', value: UserRole.LEVEL_3_USER },
];

// 用户角色文本映射
export const USER_ROLE_TEXT = {
  [UserRole.SUPER_ADMIN]: '超级管理员',
  [UserRole.ADMIN]: '管理员',
  [UserRole.INSTRUMENT_MANAGER]: '仪器负责人',
  [UserRole.INSTRUMENT_OPERATOR]: '仪器操作员',
  [UserRole.FINANCE]: '财务',
  [UserRole.LEVEL_1_USER]: '1级用户',
  [UserRole.LEVEL_2_USER]: '2级用户',
  [UserRole.LEVEL_3_USER]: '3级用户',
};

// 用户状态选项
export const USER_STATUS_OPTIONS = [
  { label: '正常', value: UserStatus.NORMAL, color: 'green' },
  { label: '禁用', value: UserStatus.DISABLED, color: 'red' },
];

// 用户状态文本映射
export const USER_STATUS_TEXT = {
  [UserStatus.NORMAL]: '正常',
  [UserStatus.DISABLED]: '禁用',
};

// 角色权限映射
export const ROLE_PERMISSIONS = {
  [UserRole.SUPER_ADMIN]: [
    'user_manage',
    'instrument_manage',
    'order_manage',
    'team_manage',
    'system_manage',
    'finance_manage',
  ],
  [UserRole.ADMIN]: [
    'user_manage',
    'instrument_manage',
    'order_manage',
    'team_manage',
    'system_manage',
  ],
  [UserRole.INSTRUMENT_MANAGER]: [
    'instrument_manage',
    'order_manage',
  ],
  [UserRole.INSTRUMENT_OPERATOR]: [
    'order_manage',
  ],
  [UserRole.FINANCE]: [
    'finance_manage',
    'order_manage',
  ],
  [UserRole.LEVEL_1_USER]: [],
  [UserRole.LEVEL_2_USER]: [],
  [UserRole.LEVEL_3_USER]: [],
};

// 登录类型选项
export const LOGIN_TYPE_OPTIONS = [
  { label: '手机号登录', value: 'phone' },
  { label: '微信登录', value: 'wechat' },
];

// 预约状态常量
export const RESERVATION_STATUS = {
  PENDING: 'pending',
  APPROVED: 'approved',
  REJECTED: 'rejected',
  COMPLETED: 'completed',
  CANCELLED: 'cancelled',
} as const;

// 预约状态文本映射
export const RESERVATION_STATUS_TEXT = {
  [RESERVATION_STATUS.PENDING]: '待审核',
  [RESERVATION_STATUS.APPROVED]: '已通过',
  [RESERVATION_STATUS.REJECTED]: '已驳回',
  [RESERVATION_STATUS.COMPLETED]: '已完成',
  [RESERVATION_STATUS.CANCELLED]: '已取消',
} as const;

// 客户状态常量
export const CUSTOMER_STATUS = {
  ACTIVE: 'active',
  INACTIVE: 'inactive',
} as const;

// 客户状态文本映射
export const CUSTOMER_STATUS_TEXT = {
  [CUSTOMER_STATUS.ACTIVE]: '活跃',
  [CUSTOMER_STATUS.INACTIVE]: '非活跃',
} as const; 